<!--
<?php
print <<<EOT
-->
<SCRIPT LANGUAGE="JavaScript">
<!--
function postbuy(t){
	if(t=='shopping'){
		window.self.close();return false;
	}
	document.form_buy.action='buy.php?step='+t+'#write';
	document.form_buy.submit();
}

function setpay(t){
	if(t=='1'){
		document.getElementById("olpaytypediv").style.display='';
	}else{
		document.getElementById("olpaytypediv").style.display='none';
	}
	
}
//-->
</SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="MainTable">
  <tr> 
    <td height="100" valign="top" class="Main"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="dragTable" >
        <tr> 
          <td class="head">
            <h3 class="L"></h3>
            <span class="TAG">购物车</span>
            <h3 class="R"></h3>
          </td>
        </tr>
        <tr> 
          <td class="middle"> 
            <table width="100%" cellspacing="5" cellpadding="5" >
              <tr> 
                <td align="left"> 
                  
                  <form name="form_buy" method="post" action="?">
                    <table width="100%" border="0" cellspacing="4" cellpadding="5" style="border:1px dotted #ccc;">
                      <tr align="center" > 
                        <td colspan="7"><b>购物清单</b></td>
                      </tr>
                      <tr align="center" bgcolor="#F0F0F0"> 
                        <td width="21%" bgcolor="#F0F0F0"><b><font color="#FF0000">商品名称</font></b></td>
                        <td width="15%"><b><font color="#FF0000">商品型号</font></b></td>
                        <td width="18%"><b><font color="#FF0000">商品编号</font></b></td>
                        <td width="9%"><b><font color="#FF0000">数 量</font></b> 
                        </td>
                        <td width="14%"><b><font color="#FF0000">单 价 </font></b></td>
                        <td width="15%"><b><font color="#FF0000">总价</font></b></td>
                        <td width="8%"><b><font color="#FF0000">扔弃</font></b></td>
                      </tr>
                      <!--
EOT;
foreach($listdb AS  $key=>$rs){
print <<<EOT
-->
                      <tr > 
                        <td width="21%" ><a href="$webdb[www_url]/bencandy.php?fid=$rs[fid]&id=$rs[aid]" target="_blank">$rs[title]</a></td>
                        <td width="15%" align="center" >$rs[shoptype]</td>
                        <td width="18%" align="center" >$rs[shop_id]</td>
                        <td width="9%" align="center" > 
                          <input type="text" size="4" value="$rs[num]" name="product[{$rs[aid]}]">
                           
                        </td>
                        <td align="center" width="14%" ><font color="#FF0000">{$rs[nowprice]}</font>元</td>
                        <td align="center" width="15%" ><font color="#FF0000">{$rs[totalprice]}</font>元</td>
                        <td align="center" width="8%" ><a href="?job=del&did=$rs[aid]">清除</a></td>
                      </tr>
                      <!--
EOT;
}
print <<<EOT
-->
                      <tr align="left"> 
                        <td colspan="7" style="border-top:1px dotted #ccc;"><b><font color="#0000FF">总共需要支付:</font></b><font color="#FF0000">{$totalmoney}</font>元</td>
                      </tr>
                      <tr align="center"> 
                        <td colspan="7"> 
                          <input type="button" name="Submit3" value="调整数量" onClick="postbuy('updateNum')">
                          <input type="button" name="Submit2" value="继续购物" onClick="postbuy('shopping')">
                          <input type="button" name="Submit4" value="结帐" onClick="postbuy('write')">
                        </td>
                      </tr>
                    </table>
                  </form>
                  <!--
EOT;
if($step=='write'){print <<<EOT
--><a name='write'></a>
<SCRIPT LANGUAGE="JavaScript">
<!--
function postorder(){
	if(document.getElementById('buyer').value==''){
		alert("顾客姓名不能为空");
		document.getElementById('buyer').focus();
		return false;
	}
	if(document.getElementById('mobphone').value==''){
		alert("手机不能为空");
		document.getElementById('mobphone').focus();
		return false;
	}
	document.form_order.submit();
}
//-->
</SCRIPT>                  <table width="100%" border="0" cellspacing="4" cellpadding="4" style="border:1px dotted #ccc;margin-top:5px;">
                    <form name="form_order" method="post" action="?action=order">
                      <tr align="center" bgcolor="#F0F0F0" > 
                        <td colspan="2"><b>订单资料</b></td>
                      </tr>
                      <tr> 
                        <td width="16%">顾客姓名:(<font color="#FF0000">*</font>)</td>
                        <td width="84%"> 
                          <input type="text" name="buyer" id="buyer">
                          <input type="radio" name="sex" value="先生" checked>
                          先生 
                          <input type="radio" name="sex" value="女士">
                          女士 
<SCRIPT LANGUAGE="JavaScript">
<!--
//document.getElementById('buyer').focus();
//-->
</SCRIPT>
						  </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系电话:</td>
                        <td width="84%"> 
                          <input type="text" name="telphone">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系手机:(<font color="#FF0000">*</font>)</td>
                        <td width="84%"> 
                          <input type="text" name="mobphone" id="mobphone">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系邮箱:</td>
                        <td width="84%"> 
                          <input type="text" name="email">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系QQ:</td>
                        <td width="84%"> 
                          <input type="text" name="oicq">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">邮政编码:</td>
                        <td width="84%"> 
                          <input type="text" name="postalcode">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">配送方式:</td>
                        <td width="84%"> 
                          <input type="radio" name="sendType" value="送货上门">
                          上门取货 
                          <input type="radio" name="sendType" value="EMS快递">
                          EMS快递(加收<font color="#FF0000">{$webdb[ShopEmsSend]}元</font>邮费) 
                          <input type="radio" name="sendType" value="其他快递" checked>
                          其他快递(加收<font color="#FF0000">{$webdb[ShopOtherSend]}元</font>邮费) 
                          <input type="radio" name="sendType" value="平邮">
                          平邮(加收<font color="#FF0000">{$webdb[ShopNormalSend]}元</font>邮费) 
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">支付方式:(<font color="#FF0000">*</font>)</td>
                        <td width="84%"> 
                          <input type="radio" name="payType" value="货到付款" onclick="setpay('0')">
                          货到付款 
                          <input type="radio" name="payType" value="在线支付" checked  >
                          在线支付 
                          <input type="radio" name="payType" value="其他方式付款" onclick="setpay('0')">
                          其他方式付款(银行电汇、ATM转帐、邮局汇款等等)<br>
                         
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系地址:</td>
                        <td width="84%"> 
                          <textarea name="address" cols="70" rows="5"></textarea>
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">附注留言:</td>
                        <td width="84%"> 
                          <textarea name="otherSay" cols="70" rows="5"></textarea>
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">相关说明:</td>
                        <td width="84%">1.收到订单后,我们承诺三天内发货,有任何问题请电话咨询!<br>
                          2.下订单后,请劳记你的订单号,方便今后查询.<br>
                          3.下订单前,请最好电话联系我们,是否还有现货. </td>
                      </tr>
                      <tr> 
                        <td width="16%">&nbsp;</td>
                        <td width="84%"> 
                          <input type="button" name="Submit" value="提交订单" onclick="postorder()">
                        </td>
                      </tr>
                    </form>
                  </table>
                  <!--
EOT;
}
print <<<EOT
-->
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td class="foot">
            <h3 class="L"></h3>
            <h3 class="R"></h3>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<!--
EOT;
?>
-->
